home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / tools / internet-tools / connect-line / cl / rexx / cl-deletegroup.clrexx < prev    next >
Encoding:
Text File  |  1996-02-05  |  3.3 KB  |  157 lines

  1. /*
  2. **  $VER: CL-DeleteGroup.clrexx 0.2 (05 Feb 1996)  **
  3. **
  4. **        © 1995 Ralf Ramge
  5. **
  6. **  PROGRAMNAME:
  7. **      CL-DeleteGroup.clrexx
  8. **
  9. **  FUNCTION:
  10. **      Wenn man eine Gruppe löschen oder ändern will, ist dies
  11. **      normalerweise mit Arbeit verbunden. Die neue Verwendung
  12. **      einer ehemals benutzten Gruppe kann unangenehme Seiten-
  13. **      effekte aufweisen.
  14. **      Dieses Skript verhindert Seiteneffekte, indem es die
  15. **      Datenbanken der Bretter, Systeme und User auf Vorkom-
  16. **      men der zu löschenden Gruppe durchsucht und sie jeweils
  17. **      aus dieser Gruppe austrägt. Vergessen Sie nicht, die
  18. **      Bretter, Systeme und User gegebenenfalls neuen Gruppen
  19. **      zuzuweisen.
  20. **
  21. **  $HISTORY:
  22. **
  23. **   27 Dec 1995 : 0.01 : initial release
  24. **   05 Feb 1996 : 0.2  : kleinere Fixes
  25. */
  26.  
  27. param=upper(arg(1))
  28.  
  29. /* rexxsupport.library öffnen */
  30.  
  31. if ~show('L','rexxsupport.library') then do
  32.     if ~addlib('rexxsupport.library',0,-30,0) then exit 10
  33.     end
  34.  
  35. /* cl_rexx.library öffnen */
  36.  
  37. if ~show('L','cl_rexx.library') then do
  38.     if ~addlib('cl_rexx.library',0,-30,0) then exit
  39.     end
  40.  
  41. /* Fontsize ermitteln */
  42.  
  43. gfxbase=showlist(l,'graphics.library',0,a)
  44. call forbid
  45. FontAddress=next(gfxbase,154)
  46. Fontsize=c2d(IMPORT(offset(FontAddress,20),2))
  47. call permit
  48. windowwidth=Fontsize*50
  49. windowheight=Fontsize*15
  50. windowY=Fontsize+1
  51. WindowX=Fontsize
  52.  
  53.  
  54.  
  55. /* Standard-IO umleiten */
  56.  
  57. screen=CLGET_FrontScreenName()
  58.  
  59. call close STDOUT
  60. if ~open(STDOUT,'CON:'windowX'/'windowY'/'windowwidth'/'windowheight'/CL-DeleteGroup/SCREEN'screen,'W') then
  61.     exit 20
  62. else do
  63.     call close STDIN
  64.     call open STDIN,'*',R
  65.     call pragma '*'
  66.     end
  67.  
  68.  
  69.  
  70. if param='' then do
  71.     options prompt 'Gruppenname : '
  72.     pull param
  73.     param=upper(param)
  74.     end
  75.  
  76. if param='' then do
  77.     say 'Aufruf: rx CL-DeleteGroup.clrexx <Gruppe>'
  78.     exit 20
  79.     end
  80.  
  81. grnum=0
  82. brettctr=0
  83. sysctr=0
  84. userctr=0
  85.  
  86. do i=1 to 96
  87.     if upper(CLGET_GroupName(i))=param then do
  88.         grnum=i
  89.         say 'Gruppennummer : 'i
  90.         end
  91.     end
  92.  
  93. if grnum=0 then do
  94.     say 'Die angegebene Gruppe existiert nicht!'
  95.     call ende
  96.     end
  97.  
  98. /* Bretter */
  99.  
  100. anzahl=CLGET_BoardList(brett)
  101. if anzahl>0 then do
  102.     do i=1 to anzahl-1
  103.         test=CLIS_BoardGroup(brett.i,grnum)
  104.         if test='1' then do
  105.             call CLSET_BoardGroup(brett.i,grnum,0)
  106.             brettctr=brettctr+1
  107.             say 'Brett gefunden: 'brett.i
  108.             end
  109.         end
  110.     end
  111. call CL_SaveBoardList()
  112.  
  113.  
  114. /* Systeme */
  115.  
  116. anzahl=CLGET_SystemNumberOf()
  117. if anzahl>0 then do
  118.     do i=1 to anzahl
  119.         system=CLGET_SystemName(i)
  120.         if CLIS_SystemGroup(system,grnum) then do
  121.             call CLSET_SystemGroup(system,grnum,0)
  122.             sysctr=sysctr+1
  123.             say 'System gefunden: 'system
  124.             end
  125.         end
  126.     end
  127.  
  128. /* User */
  129.  
  130. anzahl=CLGET_UserNumberOf()
  131. if anzahl>0 then do
  132.     do i=1 to anzahl
  133.         user=CLGET_UserName(i)
  134.         if CLIS_UserGroup(user,grnum) then do
  135.             call CLSET_UserGroup(user,grnum,0)
  136.             userctr=userctr+1
  137.             say 'User gefunden: 'user
  138.             end
  139.         end
  140.     end
  141.  
  142.  
  143. say 'Insgesamt wurden verändert:'
  144. say '---------------------------'
  145. say 'Bretter    : 'brettctr
  146. say 'Systeme    : 'sysctr
  147. say 'User       : 'userctr
  148.  
  149. ende:
  150.  
  151. options prompt 'Bitte drücken Sie <RETURN>'
  152. pull dummy
  153.  
  154. call close STDOUT
  155. call close STDIN
  156. exit
  157.